package cn.vote.model;

// Generated 2014-6-29 1:14:17 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Voteitem generated by hbm2java
 */
@Entity
@Table(name = "voteitem", catalog = "vote")
public class Voteitem implements java.io.Serializable {

	private Integer id;
	private Votetheme votetheme;
	private String content;
	private List<Voteinfo> voteinfos = new ArrayList<Voteinfo>(0);

	public Voteitem() {
	}

	public Voteitem(Votetheme votetheme, String content) {
		this.votetheme = votetheme;
		this.content = content;
	}

	public Voteitem(Votetheme votetheme, String content, List<Voteinfo> voteinfos) {
		this.votetheme = votetheme;
		this.content = content;
		this.voteinfos = voteinfos;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "themeid", nullable = false)
	public Votetheme getVotetheme() {
		return this.votetheme;
	}

	public void setVotetheme(Votetheme votetheme) {
		this.votetheme = votetheme;
	}

	@Column(name = "content", nullable = false, length = 100)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "voteitem")
	public List<Voteinfo> getVoteinfos() {
		return this.voteinfos;
	}

	public void setVoteinfos(List<Voteinfo> voteinfos) {
		this.voteinfos = voteinfos;
	}

}
